/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ifrr.gepro.projeto.bean;

import br.ifrr.gepro.pessoa.bean.ClienteBean;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author rafael
 */
@Entity
@Table(name = "projeto", catalog = "gepro", schema = "public")
public class ProjetoBean implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id_projeto", nullable = false, insertable=false)
    private Integer idProjeto;
    @Column(name = "nome", length = 70)
    private String nome;
    @Column(name = "descricao", length = 225)
    private String descricao;
    @Column(name = "data_in")
    @Temporal(TemporalType.DATE)
    private Date dataIn;
    @Column(name = "data_fim")
    @Temporal(TemporalType.DATE)
    private Date dataFim;
    @Column(name = "situacao", length = 100)
    private String situacao;
    @JoinColumn(name = "fk_equipe", referencedColumnName = "id_equipe")
    @ManyToOne
    private EquipeBean fkEquipe;
    @JoinColumn(name = "fk_cliente", referencedColumnName = "id_cliente")
    @ManyToOne
    private ClienteBean fkCliente;
//    @OneToMany(mappedBy = "fkProjeto")
//    private Collection<EquipeBean> equipeBeanCollection;
//    @OneToMany(mappedBy = "fkProj")
//    private Collection<SprintBean> sprintBeanCollection;
//    @OneToMany(mappedBy = "fkProj")
//    private Collection<EstoriasBean> estoriasBeanCollection;

    public ProjetoBean() {
    }

    public ProjetoBean(Integer idProjeto) {
        this.idProjeto = idProjeto;
    }

    public Integer getIdProjeto() {
        return idProjeto;
    }

    public void setIdProjeto(Integer idProjeto) {
        this.idProjeto = idProjeto;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public Date getDataIn() {
        return dataIn;
    }

    public void setDataIn(Date dataIn) {
        this.dataIn = dataIn;
    }

    public Date getDataFim() {
        return dataFim;
    }

    public void setDataFim(Date dataFim) {
        this.dataFim = dataFim;
    }

    public String getSituacao() {
        return situacao;
    }

    public void setSituacao(String situacao) {
        this.situacao = situacao;
    }

    public EquipeBean getFkEquipe() {
        return fkEquipe;
    }

    public void setFkEquipe(EquipeBean fkEquipe) {
        this.fkEquipe = fkEquipe;
    }

    public ClienteBean getFkCliente() {
        return fkCliente;
    }

    public void setFkCliente(ClienteBean fkCliente) {
        this.fkCliente = fkCliente;
    }

//    public Collection<EquipeBean> getEquipeBeanCollection() {
//        return equipeBeanCollection;
//    }
//
//    public void setEquipeBeanCollection(Collection<EquipeBean> equipeBeanCollection) {
//        this.equipeBeanCollection = equipeBeanCollection;
//    }
//
//    public Collection<SprintBean> getSprintBeanCollection() {
//        return sprintBeanCollection;
//    }
//
//    public void setSprintBeanCollection(Collection<SprintBean> sprintBeanCollection) {
//        this.sprintBeanCollection = sprintBeanCollection;
//    }
//
//    public Collection<EstoriasBean> getEstoriasBeanCollection() {
//        return estoriasBeanCollection;
//    }
//
//    public void setEstoriasBeanCollection(Collection<EstoriasBean> estoriasBeanCollection) {
//        this.estoriasBeanCollection = estoriasBeanCollection;
//    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idProjeto != null ? idProjeto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProjetoBean)) {
            return false;
        }
        ProjetoBean other = (ProjetoBean) object;
        if ((this.idProjeto == null && other.idProjeto != null) || (this.idProjeto != null && !this.idProjeto.equals(other.idProjeto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ifrr.gepro.ProjetoBean[ idProjeto=" + idProjeto + " ]";
    }
    
}
